﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace NOVO_USB2XXX
{
    class NovoComm
    {
        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Winapi)]
        public static extern Int32 Novo_CreateSdk();

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern void Novo_DeleteSdk();

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_InitDev(IntPtr devConfig);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_EnumDevice();

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_SetDeviceId(int devID);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_OpenDevice();

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_CloseDevice();

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_GetFwVersion(char[] FwVersion, int iChip);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_GetHardwareVersion(char[] HwVersion);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern char[] Novo_GetName();

        ///I2C总线
        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_IIC_Init(IntPtr I2CConfig);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 Novo_IIC_SetIndex(int IICIndex);

        [DllImport("NovoComm.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern Int32 sNovo_IIC_GetSlaveAddr(short[] pSlaveAddr);

    }
}
